//package com.sse.product.handler;
//
//import com.sse.product.common.ResultCode;
//import com.sse.product.model.rbac.ResponseVo;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.security.core.AuthenticationException;
//import org.springframework.security.web.authentication.AuthenticationFailureHandler;
//import org.springframework.stereotype.Component;
//
//import javax.servlet.ServletException;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.io.IOException;
//import java.io.PrintWriter;
//
//import static com.sse.product.common.Constants.jacksonMapper;
//
///**
// * @ClassName GatewayAuthenticationFailureHandler
// * @Description TODO
// * @Author junyongli
// * @Date 2022/7/1 9:35
// * @Version 1.0
// **/
//@Component
//@Slf4j
//public class ProductAuthenticationFailureHandler implements AuthenticationFailureHandler {
//    @Override
//    public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException e) throws IOException, ServletException {
//        log.warn("[GatewayAuthenticationFailureHandler.onAuthenticationFailure] AuthenticationException : {}", e);
//        response.setContentType("application/json;charset=utf-8");
//        PrintWriter out = response.getWriter();
//        out.write(jacksonMapper.writeValueAsString(ResponseVo.assemble(ResultCode.LOGIN_FAIL)));
//        out.flush();
//        out.close();
//    }
//}
